home *** CD-ROM | disk | FTP | other *** search
- (***********************************)
- (* TWINS Version 1.01 *)
- (***********************************)
- (* Object - Oriented Windows *)
- (* for Turbo Pascal Version 5.5 *)
- (* Copyright 1990 *)
- (* Brian Corll *)
- (* ALL RIGHTS RESERVED *)
- (***********************************)
- (***********************************)
- (* Turbo Pascal is a registered *)
- (* trademark of Borland Int. Corp. *)
- (***********************************)
- (* Portions Copyright 1984,1989 *)
- (* Borland International Corp. *)
- (***********************************)
- (***********************************)
-
-
- UNIT Screens;
-
-
- {$L Flash}
- {$L Attr}
- {$L Screen}
-
-
- INTERFACE
-
- Uses DOS;
-
- TYPE
- Borders = String[6];
- VertStr = String[25];
- Direction = (Up,Down);
-
- CONST
-
- SolidBrdr : Borders = '██████';
- SingleBrdr : Borders = '┌└┐┘─│';
- DoubleBrdr : Borders = '╔╚╗╝═║';
- Stars : Borders = '******';
- QuarterTone : Borders = '░░░░░░';
- HalfTone : Borders = '▒▒▒▒▒▒';
- Chr254 : Borders = '■■■■■■';
-
- {Color constants - defined to take advantage of Turbo Pascal's
- constant folding capabilities. See documentation.}
-
-
- Black = $00; DarkGray = $08;
- Blue = $01; LightBlue = $09;
- Green = $02; LightGreen = $0A;
- Cyan = $03; LightCyan = $0B;
- Red = $04; LightRed = $0C;
- Magenta = $05; LightMagenta = $0D;
- Brown = $06; Yellow = $0E;
- LightGray = $07; White = $0F;
- Blink = $80;
-
- BlackBG = $00;
- BlueBG = $10;
- GreenBG = $20;
- CyanBG = $30;
- RedBG = $40;
- MagentaBG = $50;
- BrownBG = $60;
- LightGrayBG = $70;
-
-
-
- TYPE
- ScreenType = Array[0..3999] of Byte;
- ScrPtr = ^ScreenType;
- DisplayType = (Monochrome, CGA, EGA, MCGA, VGA);
-
- VAR
- VideoBase : WORD;
- VideoWait : BOOLEAN;
- SnowCheck : BOOLEAN;
- VideoOffset : BYTE;
- VideoMode : BYTE;
- VideoWidth : BYTE;
- VideoPage : BYTE;
- Mono : BOOLEAN;
- Regs : Registers;
- VidMode : BYTE;
-
-
-
- FUNCTION SaveScreen : ScrPtr;
- (* Saves the entire screen in VAR of type ScrPtr *)
-
- PROCEDURE RestoreScreen(VAR SavedScreen : ScrPtr);
- (* Restores screen previously saved in VAR of type ScrPtr *)
-
- PROCEDURE RestScr(SRow,SCol,ERow,ECol : BYTE;VAR Buffer : POINTER);
- (* Restores an area of a screen previously saved in a buffer *)
-
- PROCEDURE SaveScr(SRow,SCol,ERow,ECol : BYTE;VAR Buffer : POINTER);
- (* Saves an area of a screen in a buffer *)
-
- PROCEDURE Flash(Row,Col, Attr:byte; Str : String);
- (* Writes a string directly to video memory *)
-
- PROCEDURE CursorOn;
-
- PROCEDURE CursorOff;
-
- PROCEDURE BlockCursor;
-
- PROCEDURE DrawBox(Row1,Col1,Row2,Col2 : Byte;Color : Byte;BorderType : Borders);
-
- PROCEDURE ChAttr(Number : Word; Row, Col, Attr : Word);
- (* Changes a specified number of video attributes at a specified row and column *)
-
- PROCEDURE ChAllAttr(Row,Col,Rows,Cols,Attr : Word);
-
- PROCEDURE FlashC(Row,Attr:Byte;Str : String);
-
- PROCEDURE ScreenToBuffer(VAR Source,Dest;Length:WORD);
- (* Moves a screen region to a memory buffer *)
-
- PROCEDURE BufferToScreen(VAR Source,Dest; Length:WORD);
- (* Restores a screen region from a memory buffer *)
-
- PROCEDURE Vertical(Row,Col,Color : BYTE;Str : VertStr);
- (* Writes a string vertically *)
-
- PROCEDURE Diagonal(Row,Col,Color,Increment : BYTE;Str : String);
- (* Writes a string diagonally *)
-
- PROCEDURE HBar(Row,Col,Len,Color : BYTE;BarChar : CHAR);
- (* Creates a horizontal textmode bar *)
-
- PROCEDURE VBar(Row,Col,Len,Color : BYTE;BarStr : String);
- (* Creates a vertical textmode bar *)
-
- PROCEDURE Scroll(NumLines,SRow,SCol,ERow,ECol,Color : BYTE;
- WhichWay : Direction);
- (* Scrolls a screen region. NumLines = 0 clears the screen region. *)
-
- PROCEDURE GetVideoStatus;
- (* Gets current video status and returns it in global VARS VideoMode,
- VideoWodth,VideoPage *)
-
- PROCEDURE SetVideoMode(Mode : BYTE);
- (* Select a video mode from 0..3 *)
-
- PROCEDURE SetVisiblePage(Page : BYTE);
- (* Set visible video page 0..3 *)
-
- PROCEDURE SetVirtualPage(Page : BYTE);
- (* Set virtual video page 0..3 *)
-
- PROCEDURE ClearVirtualPage(Color : BYTE);
- (* Clear a virtual page using a specified color attribute *)
-
- FUNCTION PrintScreen : BOOLEAN;
- (* Print a screen and return success/failure *)
-
- PROCEDURE ClearScreen(SRow,SCol,ERow,ECol,Color : BYTE);
- (* Clear a screen region using a specified color attribute *)
-